package com.dk.service.impl;

import com.dk.dao.AdminRepository;
import com.dk.pojo.Admin;
import com.dk.service.AdminService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author gcx
 * @date 2020/6/22
 */
@Service
public class AdminServiceImpl implements AdminService {

    private final AdminRepository adminRepository;

    public AdminServiceImpl(AdminRepository adminRepository){
        this.adminRepository = adminRepository;
    }

    @Override
    public List<Admin> get() {
        return adminRepository.findAll();
    }

    @Override
    public void set() {
        Admin admin = new Admin();
        admin.setName("table");
        adminRepository.save(admin);
    }
}
